using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._MultidimensionalAnalysis
{
    /// <summary>
    /// <para>Generate Trend Raster</para>
    /// <para>Estimates the trend for each pixel along a dimension for one or more variables in a multidimensional raster.</para>
    /// <para>估计多维栅格中一个或多个变量沿维度的每个像素的趋势。</para>
    /// </summary>    
    [DisplayName("Generate Trend Raster")]
    public class GenerateTrendRaster : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateTrendRaster()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_multidimensional_raster">
        /// <para>Input Multidimensional Raster</para>
        /// <para>The input multidimensional raster dataset.</para>
        /// <para>输入多维栅格数据集。</para>
        /// </param>
        /// <param name="_out_multidimensional_raster">
        /// <para>Output Multidimensional Raster</para>
        /// <para>The output Cloud Raster Format (CRF) multidimensional raster dataset.</para>
        /// <para>输出云栅格格式 （CRF） 多维栅格数据集。</para>
        /// </param>
        /// <param name="_dimension">
        /// <para>Dimension</para>
        /// <para>The dimension along which a trend will be extracted for the variable or variables selected in the analysis.</para>
        /// <para>为分析中选择的一个或多个变量提取趋势的维度。</para>
        /// </param>
        public GenerateTrendRaster(object _in_multidimensional_raster, object _out_multidimensional_raster, object _dimension)
        {
            this._in_multidimensional_raster = _in_multidimensional_raster;
            this._out_multidimensional_raster = _out_multidimensional_raster;
            this._dimension = _dimension;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Generate Trend Raster";

        public override string CallName => "ia.GenerateTrendRaster";

        public override List<string> AcceptEnvironments => ["cellSize", "compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_multidimensional_raster, _out_multidimensional_raster, _dimension, _variables, _line_type.GetGPValue(), _frequency, _ignore_nodata.GetGPValue(), _cycle_length, _cycle_unit.GetGPValue(), _rmse.GetGPValue(), _r2.GetGPValue(), _slope_p_value.GetGPValue(), _seasonal_period.GetGPValue()];

        /// <summary>
        /// <para>Input Multidimensional Raster</para>
        /// <para>The input multidimensional raster dataset.</para>
        /// <para>输入多维栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Multidimensional Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_multidimensional_raster { get; set; }


        /// <summary>
        /// <para>Output Multidimensional Raster</para>
        /// <para>The output Cloud Raster Format (CRF) multidimensional raster dataset.</para>
        /// <para>输出云栅格格式 （CRF） 多维栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Multidimensional Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_multidimensional_raster { get; set; }


        /// <summary>
        /// <para>Dimension</para>
        /// <para>The dimension along which a trend will be extracted for the variable or variables selected in the analysis.</para>
        /// <para>为分析中选择的一个或多个变量提取趋势的维度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dimension")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _dimension { get; set; }


        /// <summary>
        /// <para>Variables [Dimension Info] (Description)</para>
        /// <para>The variable or variables for which trends will be calculated. If no variable is specified, the first variable in the multidimensional raster will be analyzed.</para>
        /// <para>将为其计算趋势的一个或多个变量。如果未指定变量，则将分析多维栅格中的第一个变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Variables [Dimension Info] (Description)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _variables { get; set; } = null;


        /// <summary>
        /// <para>Trend Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of trend analysis to perform to pixel values along a dimension.</para>
        ///   <bulletList>
        ///     <bullet_item>Linear—Variable pixel values will be fitted along a linear trend line. This is the default.</bullet_item><para/>
        ///     <bullet_item>Polynomial—Variable pixel values will be fitted along a second order polynomial trend line.</bullet_item><para/>
        ///     <bullet_item>Harmonic—Variable pixel values will be fitted along a harmonic trend line.</bullet_item><para/>
        ///     <bullet_item>Mann-Kendall—Variable pixel values will be evaluated using the Mann-Kendall trend test.</bullet_item><para/>
        ///     <bullet_item>Seasonal-Kendall—Variable pixel values will be evaluated using the Seasonal-Kendall trend test.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要对沿维度的像素值执行的趋势分析类型。</para>
        ///   <bulletList>
        ///     <bullet_item>线性—可变像素值将沿线性趋势线拟合。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>多项式—可变像素值将沿二阶多项式趋势线拟合。</bullet_item><para/>
        ///     <bullet_item>谐波—可变像素值将沿谐波趋势线拟合。</bullet_item><para/>
        ///     <bullet_item>Mann-Kendall—将使用 Mann-Kendall 趋势检验评估可变像素值。</bullet_item><para/>
        ///     <bullet_item>Seasonal-Kendall—将使用 Seasonal-Kendall 趋势检验评估可变像素值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Trend Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _line_type_value _line_type { get; set; } = _line_type_value._LINEAR;

        public enum _line_type_value
        {
            /// <summary>
            /// <para>Linear</para>
            /// <para>Linear—Variable pixel values will be fitted along a linear trend line. This is the default.</para>
            /// <para>线性—可变像素值将沿线性趋势线拟合。这是默认设置。</para>
            /// </summary>
            [Description("Linear")]
            [GPEnumValue("LINEAR")]
            _LINEAR,

            /// <summary>
            /// <para>Harmonic</para>
            /// <para>Harmonic—Variable pixel values will be fitted along a harmonic trend line.</para>
            /// <para>谐波—可变像素值将沿谐波趋势线拟合。</para>
            /// </summary>
            [Description("Harmonic")]
            [GPEnumValue("HARMONIC")]
            _HARMONIC,

            /// <summary>
            /// <para>Polynomial</para>
            /// <para>Polynomial—Variable pixel values will be fitted along a second order polynomial trend line.</para>
            /// <para>多项式—可变像素值将沿二阶多项式趋势线拟合。</para>
            /// </summary>
            [Description("Polynomial")]
            [GPEnumValue("POLYNOMIAL")]
            _POLYNOMIAL,

            /// <summary>
            /// <para>Mann-Kendall</para>
            /// <para>Mann-Kendall—Variable pixel values will be evaluated using the Mann-Kendall trend test.</para>
            /// <para>Mann-Kendall—将使用 Mann-Kendall 趋势检验评估可变像素值。</para>
            /// </summary>
            [Description("Mann-Kendall")]
            [GPEnumValue("MANN-KENDALL")]
            value3,

            /// <summary>
            /// <para>Seasonal-Kendall</para>
            /// <para>Seasonal-Kendall—Variable pixel values will be evaluated using the Seasonal-Kendall trend test.</para>
            /// <para>Seasonal-Kendall—将使用 Seasonal-Kendall 趋势检验评估可变像素值。</para>
            /// </summary>
            [Description("Seasonal-Kendall")]
            [GPEnumValue("SEASONAL-KENDALL")]
            value4,

        }

        /// <summary>
        /// <para>Frequency / Polynomial Order</para>
        /// <para><xdoc>
        ///   <para>The frequency or the polynomial order number to use in the trend fitting. If the trend type is polynomial, this parameter specifies the polynomial order. If the trend type is harmonic, this parameter specifies the number of models to use to fit the trend.</para>
        ///   <para>This parameter is only included in the trend analysis when the dimension being analyzed is time.</para>
        ///   <para>If the Trend Type parameter is Harmonic, the default value is 1, meaning a first order harmonic curve is used to fit the model.</para>
        ///   <para>If the Trend Type parameter is Polynomial, the default value is 2, or second order polynomial.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>趋势拟合中使用的频率或多项式阶数。如果趋势类型为多项式，则此参数指定多项式顺序。如果趋势类型为谐波，则此参数指定用于拟合趋势的模型数。</para>
        ///   <para>仅当所分析的维度为时间时，此参数才包含在趋势分析中。</para>
        ///   <para>如果趋势类型参数为谐波，则默认值为 1，这意味着使用一阶谐波曲线来拟合模型。</para>
        ///   <para>如果趋势类型参数为多项式，则默认值为 2 或二阶多项式。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Frequency / Polynomial Order")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _frequency { get; set; } = null;


        /// <summary>
        /// <para>Ignore NoData</para>
        /// <para><xdoc>
        ///   <para>Specifies whether NoData values are ignored in the analysis.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The analysis will result in NoData if there are any NoData values for the pixels along the given dimension.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否在分析中忽略 NoData 值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 分析将包括给定维度上的所有有效像素，并忽略任何 NoData 像素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果给定维度上的像素有任何 NoData 值，则分析将生成 NoData。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore NoData")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_nodata_value _ignore_nodata { get; set; } = _ignore_nodata_value._true;

        public enum _ignore_nodata_value
        {
            /// <summary>
            /// <para>DATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NODATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NODATA")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Length of Cycle</para>
        /// <para><xdoc>
        ///   <para>The length of periodic variation to model. This parameter is required when Trend Type is set to Harmonic. For example, leaf greenness often has one strong cycle of variation in a single year, so the cycle length is 1 year. Hourly temperature data has one strong cycle of variation throughout a single day, so the cycle length is 1 day.</para>
        ///   <para>The default length is 1 year for data that varies on an annual cycle.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>模型的周期性变化长度。当“趋势类型”设置为“谐波”时，此参数是必需的。例如，叶片绿度通常在一年内有一个强烈的变化周期，因此周期长度为1年。每小时温度数据在一天中具有很强的变化周期，因此周期长度为 1 天。</para>
        ///   <para>对于按年周期变化的数据，默认长度为 1 年。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Length of Cycle")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _cycle_length { get; set; } = null;


        /// <summary>
        /// <para>Cycle Unit</para>
        /// <para><xdoc>
        ///   <para>Specifies the time unit to be used for the length of a harmonic cycle.</para>
        ///   <bulletList>
        ///     <bullet_item>Days—The unit for the length of the harmonic cycle is days.</bullet_item><para/>
        ///     <bullet_item>Years—The unit for the length of the harmonic cycle is years. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于谐波周期长度的时间单位。</para>
        ///   <bulletList>
        ///     <bullet_item>天—谐波周期长度的单位为天。</bullet_item><para/>
        ///     <bullet_item>年—谐波周期长度的单位为年。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cycle Unit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _cycle_unit_value? _cycle_unit { get; set; } = null;

        public enum _cycle_unit_value
        {
            /// <summary>
            /// <para>Days</para>
            /// <para>Days—The unit for the length of the harmonic cycle is days.</para>
            /// <para>天—谐波周期长度的单位为天。</para>
            /// </summary>
            [Description("Days")]
            [GPEnumValue("DAYS")]
            _DAYS,

            /// <summary>
            /// <para>Years</para>
            /// <para>Years—The unit for the length of the harmonic cycle is years. This is the default.</para>
            /// <para>年—谐波周期长度的单位为年。这是默认设置。</para>
            /// </summary>
            [Description("Years")]
            [GPEnumValue("YEARS")]
            _YEARS,

        }

        /// <summary>
        /// <para>RMSE</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the root mean square error (RMSE) of the trend fit line will be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The RMSE will be calculated and displayed in the raster dataset properties window under Statistics. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The RMSE will not be calculated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否计算趋势拟合线的均方根误差 （RMSE）。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - RMSE 将被计算并显示在栅格数据集属性窗口的统计数据下。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中—不计算RMSE。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("RMSE")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _rmse_value _rmse { get; set; } = _rmse_value._true;

        public enum _rmse_value
        {
            /// <summary>
            /// <para>RMSE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RMSE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_RMSE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_RMSE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>R-Squared</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the R-squared goodness-of-fit statistic for the trend fit line will be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The R-squared value will be calculated and displayed in the raster dataset properties window under Statistics.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The R-squared value will not be calculated. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否计算趋势拟合线的 R 平方拟合优度统计量。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将计算 R 平方值并将其显示在栅格数据集属性窗口的统计数据下。</bullet_item><para/>
        ///     <bullet_item>未选中—不计算 R 平方值。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("R-Squared")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _r2_value _r2 { get; set; } = _r2_value._false;

        public enum _r2_value
        {
            /// <summary>
            /// <para>R2</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("R2")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_R2</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_R2")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>P-Value of Slope Coefficient</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the p-value statistic for the slope coefficient of the trend line will be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The p-value will be calculated and displayed in the raster dataset properties window under Statistics.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The p-value will not be calculated. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否计算趋势线斜率系数的 p 值统计量。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将计算 p 值并将其显示在栅格数据集属性窗口的统计数据下。</bullet_item><para/>
        ///     <bullet_item>未选中—不计算 p 值。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("P-Value of Slope Coefficient")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _slope_p_value_value _slope_p_value { get; set; } = _slope_p_value_value._false;

        public enum _slope_p_value_value
        {
            /// <summary>
            /// <para>SLOPEPVALUE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SLOPEPVALUE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SLOPEPVALUE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SLOPEPVALUE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Seasonal Period</para>
        /// <para><xdoc>
        ///   <para>Specifies the time unit to be used for the length of a seasonal period when performing the Seasonal-Kendall test.</para>
        ///   <bulletList>
        ///     <bullet_item>Days—The unit for the length of the seasonal period is days. This is the default.</bullet_item><para/>
        ///     <bullet_item>Months—The unit for the length of the seasonal period is months.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在执行 Seasonal-Kendall 检验时用于季节性期间长度的时间单位。</para>
        ///   <bulletList>
        ///     <bullet_item>天 - 季节性期间长度的单位为天。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>月—季节性期间长度的单位为月。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Seasonal Period")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _seasonal_period_value? _seasonal_period { get; set; } = null;

        public enum _seasonal_period_value
        {
            /// <summary>
            /// <para>Days</para>
            /// <para>Days—The unit for the length of the seasonal period is days. This is the default.</para>
            /// <para>天 - 季节性期间长度的单位为天。这是默认设置。</para>
            /// </summary>
            [Description("Days")]
            [GPEnumValue("DAYS")]
            _DAYS,

            /// <summary>
            /// <para>Months</para>
            /// <para>Months—The unit for the length of the seasonal period is months.</para>
            /// <para>月—季节性期间长度的单位为月。</para>
            /// </summary>
            [Description("Months")]
            [GPEnumValue("MONTHS")]
            _MONTHS,

        }

        public GenerateTrendRaster SetEnv(object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}